class AffairDetailModel {
  int errno;
  Data data;
  String errmsg;

  AffairDetailModel({this.errno, this.data, this.errmsg});

  AffairDetailModel.fromJson(Map<String, dynamic> json) {
    errno = json['errno'];
    data = json['data'] != null ? new Data.fromJson(json['data']) : null;
    errmsg = json['errmsg'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['errno'] = this.errno;
    if (this.data != null) {
      data['data'] = this.data.toJson();
    }
    data['errmsg'] = this.errmsg;
    return data;
  }
}

class Data {
  UserInfo userInfo;
  Goods goods;
  List<Affairss> affairss;
  Affair info;
  bool isMe;
  bool follow;

  Data({this.userInfo, this.goods, this.affairss, this.info});

  Data.fromJson(Map<String, dynamic> json) {
    userInfo = json['userInfo'] != null
        ? new UserInfo.fromJson(json['userInfo'])
        : null;
    goods = json['goods'] != null ? new Goods.fromJson(json['goods']) : null;
    if (json['affairss'] != null) {
      affairss = new List<Affairss>();
      json['affairss'].forEach((v) {
        affairss.add(new Affairss.fromJson(v));
      });
    }
    info = json['info'] != null ? new Affair.fromJson(json['info']) : null;
      isMe = json['isMe'];
      follow = json['follow'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.userInfo != null) {
      data['userInfo'] = this.userInfo.toJson();
    }
    if (this.goods != null) {
      data['goods'] = this.goods.toJson();
    }
    if (this.affairss != null) {
      data['affairss'] = this.affairss.map((v) => v.toJson()).toList();
    }
    if (this.info != null) {
      data['info'] = this.info.toJson();
    }
    return data;
  }
}

class UserInfo {
  String nickName;
  String avatarUrl;

  UserInfo({this.nickName, this.avatarUrl});

  UserInfo.fromJson(Map<String, dynamic> json) {
    nickName = json['nickName'];
    avatarUrl = json['avatarUrl'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['nickName'] = this.nickName;
    data['avatarUrl'] = this.avatarUrl;
    return data;
  }
}

class Goods {
  int id;
  String name;
  String brief;
  String picUrl;
  bool isNew;
  bool isHot;
  double counterPrice;
  double retailPrice;

  Goods(
      {this.id,
      this.name,
      this.brief,
      this.picUrl,
      this.isNew,
      this.isHot,
      this.counterPrice,
      this.retailPrice});

  Goods.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    brief = json['brief'];
    picUrl = json['picUrl'];
    isNew = json['isNew'];
    isHot = json['isHot'];
    counterPrice = json['counterPrice'];
    retailPrice = json['retailPrice'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    data['brief'] = this.brief;
    data['picUrl'] = this.picUrl;
    data['isNew'] = this.isNew;
    data['isHot'] = this.isHot;
    data['counterPrice'] = this.counterPrice;
    data['retailPrice'] = this.retailPrice;
    return data;
  }
}

class Affairss {
  UserInfo userInfo;
  Affair affair;

  Affairss({this.userInfo, this.affair});

  Affairss.fromJson(Map<String, dynamic> json) {
    userInfo = json['userInfo'] != null
        ? new UserInfo.fromJson(json['userInfo'])
        : null;
    affair =
        json['affair'] != null ? new Affair.fromJson(json['affair']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.userInfo != null) {
      data['userInfo'] = this.userInfo.toJson();
    }
    if (this.affair != null) {
      data['affair'] = this.affair.toJson();
    }
    return data;
  }
}

class Affair {
  int id;
  bool isGoods;
  bool deleted;
  int goodsId;
  int status;
  int userId;
  String addTime;
  String updateTime;
  String content;
  String url;

  Affair(
      {this.id,
      this.isGoods,
      this.deleted,
      this.goodsId,
      this.status,
      this.userId,
      this.addTime,
      this.updateTime,
      this.content,
      this.url});

  Affair.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    isGoods = json['isGoods'];
    deleted = json['deleted'];
    goodsId = json['goodsId'];
    status = json['status'];
    userId = json['userId'];
    addTime = json['addTime'];
    updateTime = json['updateTime'];
    content = json['content'];
    url = json['url'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['isGoods'] = this.isGoods;
    data['deleted'] = this.deleted;
    data['goodsId'] = this.goodsId;
    data['status'] = this.status;
    data['userId'] = this.userId;
    data['addTime'] = this.addTime;
    data['updateTime'] = this.updateTime;
    data['content'] = this.content;
    data['url'] = this.url;
    return data;
  }
}